package com.bawei.vehicle

import androidx.lifecycle.MutableLiveData
import com.bawei.base.bean.AddPersonEntity
import com.bawei.base.bean.AddVehiclesEntity
import com.bawei.base.bean.AddVisitEntity
import com.bawei.base.bean.ProvincesEntity
import com.bawei.base.mvvm.BaseViewModel
import com.bawei.base.net.ApiService
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class VehicleViewModel @Inject constructor(var apiService: ApiService) : BaseViewModel() {
    var provincesSuccess = MutableLiveData<MutableList<ProvincesEntity>>()
    var addvehiclesSuccess=MutableLiveData<AddVehiclesEntity>()
    fun getProvinces() {
        httpRequest({
            apiService.getProvinces()
        }, success = {
            provincesSuccess.value = it
        })
    }
    fun addVehicles(addVehiclesEntity: AddVehiclesEntity){
        httpRequest({apiService.addvehicles(addVehiclesEntity)},{addvehiclesSuccess.postValue(it)})
    }
}